//*************************************************************************************************
//Copyright (c) 2015.year. @hjjer.
//If you are a hjjer(hejianjiao.org), This code is unlicensed, otherwise,is licensed under the GPL.
//*************************************************************************************************

package com.truthbean.ssm.demo.domain.entity;

import com.truthbean.ssm.core.utils.StringUtil;

import java.io.Serializable;

/**
 * @author Truthbean
 * @since 2015-12-23 18:47:54
 */
public class User implements Serializable {

    private int userId;
    private String userName;
    private String password;

    public User() {
    }

    public User(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean isSame(Object obj) {
        if (obj != null && obj instanceof User) {
            User user = (User) obj;
            return StringUtil.isNotEmpty(user.getPassword()) &&
                    StringUtil.isNotEmpty(user.getUserName()) &&
                    user.getPassword().equals(password) &&
                    user.getUserName().equals(userName);
        } else {
            return false;
        }
    }
}
